package com.n9.product.entity;

import com.n9.base.entity.UuidEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.util.List;

/**
 * 供货商
 * @author ice
 * @since 2019/5/23 17:20
 */
@Getter
@Setter
@ToString(callSuper = true)
@Entity
@Table(name = "n9_product_provider")
public class Provider extends UuidEntity {
    @Column(unique = true)
    private String name;

    @Column()
    private String note;

    /**
     * 优先级：数值越小，优先级越高
     */
    @Column
    private Integer priority;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "provider")
    private List<Patent> patents;
}
